// 定义Computer类,包含品牌，处理器，内存大小，储存大小。
class Computer {
    String brand;
    String processor;
    int ramSize;
    int storageSize;

    // 构造函数
    public Computer(String brand, String processor, int ramSize, int storageSize) {
        this.brand = brand;
        this.processor = processor;
        this.ramSize = ramSize;
        this.storageSize = storageSize;
    }

    // 打印电脑配置信息
    public void printConfig() {
        System.out.println("电脑品牌: " + brand);
        System.out.println("处理器型号: " + processor);
        System.out.println("内存大小: " + ramSize + "GB");
        System.out.println("存储大小: " + storageSize + "GB");
        System.out.println();
    }
}

// 定义Student类，包含姓名和电脑
class Student {
    String name;
    Computer computer;

    // 构造函数
    public Student(String name, Computer computer) {
        this.name = name;
        this.computer = computer;
    }

    // 打印学生的电脑配置
    public void printStudentInfo() {
        System.out.println("学生: " + name);
        computer.printConfig();
    }
}

// 主类
public class SchoolSimulation {
    public static void main(String[] args) {
        // 创建computer的实例
        Computer computer1 = new Computer("七彩虹", "AMD R9 7845HX", 16, 1024);
        Computer computer2 = new Computer("MacBookPro 2024", "M1", 16, 512);
        Computer computer3 = new Computer("惠普", "intel i7", 16, 1024);

        // 创建student的实例
        Student student1 = new Student("小王", computer1);
        Student student2 = new Student("小张", computer2);
        Student student3 = new Student("小刘", computer3);

        // 按顺序输出每个学生的电脑信息
        student1.printStudentInfo();
        student2.printStudentInfo();
        student3.printStudentInfo();
    }
}